package com.sun.elasticjob.strategy;

import com.dangdang.ddframe.job.lite.api.strategy.JobInstance;
import com.dangdang.ddframe.job.lite.api.strategy.JobShardingStrategy;
import com.dangdang.ddframe.job.lite.api.strategy.impl.AverageAllocationJobShardingStrategy;

import java.util.List;
import java.util.Map;

/**
 * 作业分片策略
 */
public class MyShardingStrategy implements JobShardingStrategy {

    @Override
    public Map<JobInstance, List<Integer>> sharding(List<JobInstance> jobInstances, String jobName, int shardingTotalCount) {
        return new AverageAllocationJobShardingStrategy().sharding(jobInstances, jobName, shardingTotalCount);
    }

}
